from Base import message, intersect, SS_VALID
from DRG import MDCL_DRG

def group(record):
  adrg_zd = []
  adrg_zd1 = []
  adrg_ss = ["38.3701","54.4x02","55.3300x001","55.3400x002","55.9200x002","55.9200x006","55.9201","55.9202","55.9203","55.9204","55.9205","55.9206","55.9300","55.9300x001","55.9400","55.9500","55.9601","57.1101","57.1700x001","57.1701","57.1800x001","59.0000","59.0301","59.0302","59.1902","59.9300","59.9400","59.9501","59.9502","98.5101","98.5102","98.5103","98.5104"]
  adrg_ss1 = []
  dept_list = []

  if True and record.ssList and record.ssList[0] in adrg_ss:
    message('符合LJ1入组条件，匹配规则：主手术匹配')

    if MDCL_DRG.LJ13_group(record):
      return 'LJ13'

    if MDCL_DRG.LJ15_group(record):
      return 'LJ15'
        
    return 'LJ1'
  else:
    return ''
    
